<%@ page import='java.sql.ResultSet'%>
<%@ page import='forum.*'%>
<%@taglib uri="/WEB-INF/tlds/label.tld" prefix="lutag"%>

<%
	String sessionUsername = (String) session.getAttribute("username");
%>

<%
	DBConnectie db = new DBConnectie(Variable.getDb(),
			Variable.getDbLogin(), Variable.getDbPassword());

	db.connect();

	ResultSet rs = db.selectQuery("SELECT * FROM forum_users "
			+ "WHERE user_name =\"" + sessionUsername + "\"");

	String avatar = "";
	String member_title = "no Custom member title";
	String signature = "no Signature";

	while (rs.next()) {
		avatar = rs.getString("avatar");
		member_title = rs.getString("member_title");
		signature = rs.getString("signature");
	}

	if (avatar == null || avatar == "") {
		avatar = "./avatars/avatar_0.jpg";
	}
	if (member_title == null) {
		member_title = "";
	}
	if (signature == null) {
		signature = "";
	}

	db.close();
%>

<%@ page import='forum.*'%>
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">

<html>
<head>
<title><lutag:label name="profile" /></title>
<link rel="stylesheet" href="./css/forum.css" type="text/css">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<jsp:include page="./include/body.jsp" flush="true" />

<table width="100%" height="20" border="0" cellpadding="1"
	cellspacing="1">
	<tr>
		<td height="20" valign="top" class="pathBar"><a
			href="./index.jsp" class="pathBarLink"><%=Variable.getForumName()%></a>
		<span class="pathBarSeperator"> > </span> <a
			href="./index.jsp?page=profile" class="pathBarLink">Profile</a></td>
	</tr>
</table>
<table cellspacing="0" cellpadding="0" width="100%" class="table_bg"
	border="0" align="center">
	<tr>
		<td>
		<table cellspacing="1" cellpadding="4" width="100%" border="0">
			<tr class="tr_bg">
				<td align="left" colspan="2" class="tr_bg"><span
					class="span_style"> <b><lutag:label name="yourprofile" /></b>
				</span></td>
				<tr bgcolor="#ffffff">
					<td align="left" valign="top" width="0"><span
						class="span_style"> <b><lutag:label name="changeavater" /><lutag:label
						name="colon" /></b>
					<form action="../servlet/User.edit" method="POST" name="profile">

					<jsp:include page="./include/avatars.jsp" flush="true" /> <img
						src="<%=avatar%>" name="img" width="65" height="65" border="0"
						hspace="15"> <br>
					<br>
					<b><lutag:label name="linkto" /></b> <br>
					<lutag:label name="allowedavater" /><lutag:label name="colon" /> <br>
					<i>.gif .jpeg .jpg .png</i> <br>
					<input type="text" name="link_avatar" value="<%=avatar%>"
						size="30">
					<td align="left" valign="top" width="0"><span
						class="span_style"> <b><lutag:label name="customtitle" /><lutag:label
						name="colon" /></b> <br>
					<input type="text" name="member_title" value="<%=member_title%>"
						maxlenght="30" size="30"> <br>
					<br>
					<b><lutag:label name="signature" /><lutag:label name="colon" /></b>
					<br>
					<textarea name="signature" maxlenght="1000" cols="23" rows="5"><%=signature%></textarea>
					<br>
					</span></td>
				</tr>
				<tr bgcolor="#ffffff">
					<td align="left" valign="top" width="0"><span
						class="span_style"> <input type="submit"
						value='<lutag:label name="change"/>'></span></td>
					</form>
					<td align="left" valign="top" width="0"><span
						class="span_style"> </span></td>
				</tr>
				<tr class="table_bg">
					<td align="left" colspan="2" class="tr_bg"><span
						class="span_style"> <b><a
						href=javascript:history.go(-1);><lutag:label name="back" /></a></b> </span></td>
		</table>
		</td>
	</tr>
</table>

<jsp:include page="./include/footer.jsp" flush="true" />